{extend name='admin@public/content'}

{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">
    <!--{if auth("$classuri/add")}-->
    <button data-modal='{:url("$classuri/add")}' data-title="添加属性" class='layui-btn layui-btn-primary'><i class='fa fa-plus'></i> 添加属性</button>
    <!--{/if}-->
    <!--{if auth("$classuri/del")}-->
    <button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-primary layui-btn-danger'><i class='fa fa-remove'></i> 删除属性</button>
    <!--{/if}-->
</div>
{/block}

{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">属性名称</label>
        <div class="layui-input-inline">
            <input name="title" value="{$Think.get.title|default=''}" placeholder="属性名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">属性简称</label>
        <div class="layui-input-inline">
            <input name="abbr" value="{$Think.get.abbr|default=''}" placeholder="属性简称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">属性描述</label>
        <div class="layui-input-inline">
            <input name="desc" value="{$Think.get.desc|default=''}" placeholder="属性描述" class="layui-input">
            <input type="hidden"  name="pid" value="{$Think.get.pid|default=''}">
            <input type="hidden" name="id" value="{$Think.get.id|default=''}">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索 </button>
        <button class="layui-btn layui-btn-primary"  data-load='{:url("$classuri/index")}?title=&abbr=&desc=&pid=&id='><i class="layui-icon">&#xe615;</i> 重 置 </button>
        <button data-modal='{:url("$classuri/add")}' data-title="添加属性" class='layui-btn layui-btn-primary'><i class='fa fa-plus'></i> 添加属性</button>
    </div>
</form>
<form onsubmit="return false;" data-auto="true" method="POST">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action"/>
    <table id="test" class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
            </th>
            <th class='list-table-sort-td'>ID</th>
            <th class='list-table-sort-td'>
                <button type="submit" class="layui-btn layui-btn-normal layui-btn-xs">排 序</button>
            </th>
            <th class='text-center'>属性名称</th>
            <th class='text-center'>属性简称</th>
            <th class='text-center'>属性描述</th>
            <th class='text-center'>操作</th>
        </tr>
        </thead>
        <tbody>
        <!--{foreach $list as $key=>$vo}-->
        <tr>
            <td class='list-table-check-td'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
            </td>
            <td class='list-table-sort-td'>{$vo.id}</td>
            <td class='list-table-sort-td visible-lg'>
                <input name="_{$vo.id}" value="{$vo.sort}" class="list-sort-input"/>
            </td>
            <td class="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.name}
                {if $vo.pid}
                {if $Think.get.pid}
                <a  data-load='{:url("$classuri/index")}?&title={$Think.get.title}&desc={$Think.get.desc}&abbr={$Think.get.abbr}&pid={$Think.get.pid},{$vo.pid}&id={$Think.get.id} ' data-tips='正在加载，请稍候...'> ⇈ </a>
                {else/}
                <a  data-load='{:url("$classuri/index")}?&title={$Think.get.title}&desc={$Think.get.desc}&abbr={$Think.get.abbr}&pid={$vo.pid}&id={$Think.get.id} ' data-tips='正在加载，请稍候...'> ⇈ </a>
                {/if}
                {/if}
                {if $Think.get.id}
                <a  data-load='{:url("$classuri/index")}?&title={$Think.get.title}&desc={$Think.get.desc}&abbr={$Think.get.abbr}&pid={$Think.get.pid}&id={$Think.get.id},{$vo.id} ' data-tips='正在加载，请稍候...'> ⇊ </a>
                {else/}
                <a  data-load='{:url("$classuri/index")}?&title={$Think.get.title}&desc={$Think.get.desc}&abbr={$Think.get.abbr}&pid={$Think.get.pid}&id={$vo.id} ' data-tips='正在加载，请稍候...'> ⇊ </a>
                {/if}
            </td>
            <td class='text-center'>{$vo.abbr}</td>
            <td class='text-center'>{$vo.comment|default="<span style='color:#ccc'>没有写描述哦！</span>"}</td>
            <td class='text-center nowrap'>
                {if auth("$classuri/add")}
                <span class="text-explode">|</span>
                <a data-title="添加菜单" data-modal='{:url("$classuri/add")}?pid={$vo.id}'>添加下级属性</a>
                {/if}
                {if auth("$classuri/edit")}
                <span class="text-explode">|</span>
                <a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
                {/if}
                {if auth("$classuri/del")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'
                   href="javascript:void(0)">删除</a>
                {/if}
            </td>
        </tr>
        <!--{/foreach}-->
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
{/block}